package com.su.dolphin.control.bean;

import java.io.Serializable;

public class BaseBean implements Serializable {
    private int num;
    private int offset;

    public int getNum() {
        return num;
    }

    public void setNum(int num) {
        this.num = num;
    }

    public int getOffset() {
        return offset;
    }

    public void setOffset(int offset) {
        this.offset = offset;
    }

    /**
     * 任务执行成功(true)
     */
    public static final int STATUS_SUCCESS = 1;

    /**
     * 已到达末页
     */
    public static final int STATUS_ENDPAGE = 11;

    /**
     * 任务执行失败(false)
     */
    public static final int STATUS_FAILED = -1;

    /**
     * 任务执行成功, 但返回结果为空
     */
    public static final int STATUS_EMPTY = -2;

    /**
     * 任务执行抛出错误
     */
    public static final int STATUS_EXCEPTION = -3;
    /**
     * 网络错误
     */
    public static final int NETWORK_ERROR = -4;
    /**
     * 任务取消
     */
    public static final int CANCELED = -3;
    private int error;
    private String msg;
    private String json;
    private String url;
    private String taskKey;

    public BaseBean() {

    }

    public BaseBean(int error) {
        this.error = error;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public int getError() {
        return error;
    }

    public void setError(int error) {
        this.error = error;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public String getTaskKey() {
        return taskKey;
    }

    public void setTaskKey(String taskKey) {
        this.taskKey = taskKey;
    }

    public String getJson() {
        return json;
    }

    public void setJson(String json) {
        this.json = json;
    }

    public boolean isOk() {
        return error == 0;
    }

    @Override
    public String toString() {
        StringBuilder beanString = new StringBuilder();
        beanString.append("error=");
        beanString.append(error);
        beanString.append(", msg=");
        beanString.append(msg);
        beanString.append(", taskKey=");
        beanString.append(taskKey);
        return beanString.toString();
    }
}
